package TransactionImplementation

import (
	"SPC/AbstractTransactions"
	"SPC/Model"
)

type ChangeNameTransaction struct {
	AbstractTransactions.ChangeEmployeeTransaction
	itsName string
}

func NewChangeNameTransaction(empid int, name string)*ChangeNameTransaction{
	n := &ChangeNameTransaction{
		*AbstractTransactions.NewChangeEmployeeTransaction(empid),
		name,
	}
	n.ChangeEmployeeTransaction.Change = n.Change

	return n
}

func (c * ChangeNameTransaction)Change(e Model.Employee){
	e.SetName(c.itsName)
}